Skip to content

fix(abi-gate): fail closed when the scan inspected no ELF; install file(1) in manylinux - #1574

Open
TimeToBuildBob wants to merge 4 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/abi-gate-fail-closed-on-empty-scan
Open

TimeToBuildBob wants to merge 4 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/abi-gate-fail-closed-on-empty-scan

Conversation

@TimeToBuildBob

@TimeToBuildBob TimeToBuildBob commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The glibc 2.28 floor gate has been passing without scanning anything. On today's scheduled master run (job 138189175609, build-qt-manylinux-2-28), the ABI gate printed:

=== Scanning ELFs in: activitywatch-v0.14.4b1.dev-fc1ac55-linux-x86_64-manylinux_2_28.zip ===
  ELFs with GLIBC refs: 0 / 0 files scanned
=== Scanning ELFs in: activitywatch-linux-x86_64-manylinux_2_28.AppImage ===
  ELFs with GLIBC refs: 0 / 0 files scanned
Violations: 0
PASS: no GLIBC symbol above GLIBC_2.28 found

scan_elfs finds ELFs with find … -exec file {} + 2>/dev/null | grep ': ELF ' inside a process substitution. The manylinux container never installs file(1), and the error is discarded, so the loop runs zero times. A broken readelf is masked the same way (|| true).

Fix

  • scan_elfs exits 2 when no ELF with GLIBC version references was inspected. Every real bundle has one, so a scan that found none proves nothing.
  • The manylinux job installs file and binutils.

Test: scripts/tests/test_abi_gate.py covers three cases: an archive with no ELFs, a broken file, and a broken readelf. All three printed PASS on master and fail closed with this change. A fourth test checks that a real binary is actually inspected. The file is added to the existing host-ABI test step.

Heads-up: build-qt-manylinux-2-28 is skipped on pull_request, so the dnf change and the first real floor scan only run after merge, on the next push or scheduled run. If that run goes red with VIOLATION lines, the gate is catching a real glibc>2.28 symbol in the bundle. If it goes red with the new ERROR: no ELF… line, file/readelf still aren't usable in the container. Either way it was silently green before.

Found in a packaging-scripts review; the reproduction was independently verified.

…le(1) in manylinux

The glibc 2.28 floor gate has been passing vacuously: on the 2026-11-24
scheduled master run both the manylinux zip and AppImage reported
"ELFs with GLIBC refs: 0 / 0 files scanned" and then PASS. ELF
discovery goes through file(1) with stderr discarded, and the manylinux
container does not install it, so nothing was ever scanned.

scan_elfs now exits 2 when no ELF with GLIBC references was inspected,
and the manylinux job installs file and binutils.

Git-Session-Id: 686b7c0e-aee4-4c6e-bbb4-78e915e2bb44
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Review guide (auto-posted)

Structured warm-up for reviewers — what changed, what to run, where to look.

Key files

  • scripts/tests/test_abi_gate.py (+89/-0, Δ89)
  • .github/workflows/release.yml (+5/-3, Δ8)
  • scripts/package/abi-gate.sh (+7/-0, Δ7)

Suggested verification

  • make typecheck
  • shellcheck <changed-shell-scripts>

Known risks / watch points

  • No automatic high-risk tags; use file list + diff for judgment.

Suggested review focus

  • Confirm behavior matches the PR description acceptance criteria.
  • Skim the largest diffs first (listed above).
  • If CI is green, spot-check the highest-risk paths called out here.

Generated by scripts/github/pr-warmup-review-guide.py for #1574.

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] Safe to merge based on the reviewed changes.

Summary

The manylinux release gate now fails instead of reporting PASS when it finds no ELF with glibc version references or when readelf cannot inspect a file.

  • The manylinux GLIBC gate now requires a successful scan of versioned ELF files.

Reviews (4) · Last reviewed commit: "test(abi-gate): fail when the real reade..." · Reviewed by Greptile

Comment thread scripts/package/abi-gate.sh Resolved
Comment thread scripts/tests/test_abi_gate.py Resolved
Git-Session-Id: 8d5891e7-e575-5afb-b089-b1e978e13723
@TimeToBuildBob

This comment has been minimized.

@TimeToBuildBob

TimeToBuildBob commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 AI code review

The PR changes scan_elfs() to exit with code 2 when readelf --version-info fails or no ELF with GLIBC version references is found, and adds file -N to disable filename padding. It adds test_abi_gate.py to the release workflow's gate tests and installs file and binutils in the manylinux build job.

Safe to merge — no P0/P1 findings

Confidence 5/5

✅ No findings. The diff looks correct to me on this pass.

Files changed (3) — the diff as I read it
  • .github/workflows/release.yml — Adds test_abi_gate.py to the host-ABI test step and adds file and binutils to the manylinux dependency installation.
  • scripts/package/abi-gate.sh — Checks readelf failures explicitly, disables file output padding with -N, and exits 2 when a scan finds no ELF with GLIBC references.
  • scripts/tests/test_abi_gate.py — Adds tests for empty archives, failed file and readelf commands, partial readelf failure, mixed filename lengths, and scanning a host binary.
Previous review passes
commit score findings engine when
29cf756ddaca 3/5 2 llm 2026-11-24 11:25 UTC
7ae87e584818 5/5 0 subscription 2026-11-24 17:10 UTC

Reviewed e79ac17de6a9 · panel: codex:gpt-6.1-sol + claude-code:sonnet · subscription engine · 23s · about this reviewer

Maintainer commands

@TimeToBuildBob review (own line) — fresh review · @TimeToBuildBob fix — a worker acts on the findings. Once per comment; 👀 = received.

Comment thread scripts/package/abi-gate.sh Resolved
Comment thread scripts/tests/test_abi_gate.py Resolved
Git-Session-Id: bb2dcf34-a2f6-4d48-9c9a-0a3159624584
@TimeToBuildBob

This comment has been minimized.

Comment thread scripts/tests/test_abi_gate.py Resolved
Git-Session-Id: bb2dcf34-a2f6-4d48-9c9a-0a3159624584
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant